﻿@using KMF.Utility
@using KMF.WebUI.CustomHelpers
@model IEnumerable<KMF.Common.ProductCategoryDto>
<div class="bb_cate_breadcrumb">
    <ul class="ul clearfix" itemprop="breadcrumb">
        <li class="brc" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
            <a itemprop="url" href="/">
                <span itemprop="title">Trang chủ</span>
            </a>
        </li>
        @foreach(var item in Model)
        {
            var ControlerName = "Category";
            if (item.Depth==1)
            {
                ControlerName = "CategoryL1";
            }
            else if (item.Depth == 2)
            {
                ControlerName = "CategoryL1";
            }
            if(item.Id.Equals(Model.Last().Id))
            {
                <li class="brc" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                    <a itemprop="url" href="@Url.Action("Index",ControlerName, new { categoryName = StringUtil.RemoveSpecialCharactersVn(item.Name), categoryId = item.Id })">
                        <span itemprop="title">@item.Name</span>
                    </a>
                </li>
            }
            else
            {
                <li class="brc" itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
                    <a itemprop="url" href="@Url.Action("ProductByCateL2",ControlerName, new { categoryName = StringUtil.RemoveSpecialCharactersVn(item.Name), categoryId = item.Id,catefil = "OEJHY" })">
                        <span itemprop="title">@item.Name</span>
                    </a>
                </li>
            }
        }
    </ul>
</div>
